package com.study.sbsummary.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

// doc mongo库
@Data
@Document("displayDocument")
public class DocDetail implements Serializable {
	@Field("_id")
	private String id;
	private Long uuid;
	private String date;
	private String source;
	private String from;
	private String author;
	@Field("parse_title")
	private String parseTitle;
	@Field("text_content")
	private String textContent;
	@Field("clean_content")
	private String cleanContent;
	private String url;
	@Field("parse_content")
	private String parseContent;
	private String ctype;
	@Field("ncat_class")
	private List<String> ncatClass;
	@Field("ncat_score")
	private Map<String, Double> ncatScore;
	@Field("nsubcat_class")
	private List<String> nsubcatClass;
	@Field("nsubcat_score")
	private Map<String, Double> nsubcatScore;
	private Boolean removed = Boolean.FALSE;
	private Integer scope;
	@Field("i_alliance_scope")
	private Integer iAllianceScope;
	@Field("collection_id")
	private String collectionId;
	private String summary;
	@Field("music_id")
	private String musicId;
	private String dsource;
	private String appid;
	@Field("image_urls")
	private List<String> imageUrls;
	@Field("removed_images")
	private List<String> removedImages;
	@Field("img_scores_json")
	private String imgScoresJson;
	@Field("image_meta")
	private Map<String,ImageField> imageMeta;
	@Field("update_time")
	private String updateTime;
	@Field("tags_yd")
	private List<String> tagsYd;
	@Field("comment_count")
	private Integer commentCount = 0;
	@Field("like_count")
	private Integer likeCount = 0;


	@Data
	public static class ImageField implements Serializable {
		private Boolean animated = Boolean.FALSE;
		private String caption;
		private Integer code;
		private String format;
		@Field("index_in_news")
		private Integer indexInNews = 0;
		private Integer length = 0;
		private List<Integer> size;
		@Field("face_mtcnn")
		@JsonProperty(value = "face_mtcnn")
		private List<FaceMtcnn> faceMtcnn;

		@Data
		public static class FaceMtcnn implements Serializable {
			private int x0;
			private int y0;
			private int x1;
			private int y1;
			private float score;
		}
	}
}
